/**
 * @Copyright (C) 2018 本内容属于商业秘密，易微行(北京)科技有限公司拥有版权等所有权利.
 */
package com.xxy.web.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xxy.microservice.common.page.PageList;
import com.xxy.orders.dto.AppOrderDTO;
import com.xxy.orders.service.AppOrderService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * xuxy
 * 2018/2/8
 */
@Controller
@RequestMapping("/test")
public class AppOrderController {
    @Reference(timeout = 10000)
    AppOrderService appOrderService;

    @ResponseBody
    @RequestMapping("/list")
    public List<AppOrderDTO> findAll(){
        return appOrderService.findAll();
    }

    @ResponseBody
    @RequestMapping("/page")
    public List<AppOrderDTO> page(PageList page){
        PageList<AppOrderDTO> pagel = appOrderService.listPage(new AppOrderDTO(), page);
        List<AppOrderDTO> content = pagel.getList();
        return content;
    }

}
